#ifndef __BUOLA_GUI_AUTO_ENUMS_H__
#define __BUOLA_GUI_AUTO_ENUMS_H__

namespace buola { namespace gui {

///\addtogroup gui
///@{

//! focus grab modes
enum EGrabMode
{
    GRAB_NONE=0,
    GRAB_CONFINE=(1<<0),            //!< confine to window
    GRAB_CHILDREN=(1<<1),           //!< children get events
    GRAB_REPLACE=(1<<2),            //!< replace any active grab
    GRAB_SELFISH=(1<<3),            //!< don't send events to other grabs
    GRAB_FAKE=(1<<4),               //!< receive events if there's a grab
    GRAB_EVERYWHERE=(1<<5),         //!< \todo receive clicks everywhere
    GRAB_BUTTON=(1<<6),             //!< active while button pressed
    GRAB_REPLAY=(1<<7),             //!< also report to other window
    GRAB_POPUP=(GRAB_CHILDREN|GRAB_REPLACE)
};

DECLARE_ENUM_BITOPS(EGrabMode);

//! drag state
enum EDragState
{
    DRAG_NONE=0,
    DRAG_MOVE=(1<<0),
    DRAG_EAST=(1<<1),
    DRAG_SOUTH=(1<<2),
    DRAG_WEST=(1<<3),
    DRAG_NORTH=(1<<4),
    DRAG_CTRLALTLB=(1<<5),
    DRAG_CTRLALTRB=(1<<6)
};

DECLARE_ENUM_BITOPS(EDragState);

//! mouse button codes
enum class EMouseButton
{
    NONE=0,
    LEFT=(1<<0),
    MIDDLE=(1<<1),
    RIGHT=(1<<2),
    BACK=(1<<3),
    FORWARD=(1<<4),
    EXTRA1=(1<<5),
    EXTRA2=(1<<6),
    EXTRA3=(1<<7),
    EXTRA4=(1<<8),
    EXTRA5=(1<<9),
    EXTRA6=(1<<10),
    EXTRA7=(1<<11),
    EXTRA8=(1<<12)
};

DECLARE_ENUM_CLASS_BITOPS(EMouseButton);

enum EDNDStatus
{
    DND_UNKNOWN,
    DND_ACCEPTED,
    DND_REJECTED,
    DND_NOTAWARE,
    DND_FINISHED
};

enum EDNDActions
{
    DND_NONE=0,
    DND_COPY=(1<<0),
    DND_MOVE=(1<<1),
    DND_LINK=(1<<2),
    DND_SPECIAL=(1<<3),
    DND_ASK=(1<<4)
};

enum EShapeTypes
{
    SHAPE_NONE=0,
    SHAPE_BOUND=(1<<0),
    SHAPE_CLIP=(1<<1),
    SHAPE_INPUT=(1<<2)
};

enum EShapeActions
{
    SHAPE_SET=1,
    SHAPE_UNION=2,
    SHAPE_INTERSECTION=3,
    SHAPE_INVERT=4,
    SHAPE_SUBTRACT=5
};

enum EAttachPlace
{
    ATTACH_ANY=0,
    ATTACH_NORTH=(1<<0),
    ATTACH_WEST=(1<<1),
    ATTACH_SOUTH=(1<<2),
    ATTACH_EAST=(1<<3),
    ATTACH_HPLACES=ATTACH_NORTH|ATTACH_SOUTH,
    ATTACH_VPLACES=ATTACH_EAST|ATTACH_WEST,
    ATTACH_REPLACECLIENT=(1<<4)
};

DECLARE_ENUM_BITOPS(EAttachPlace);

enum EAttachRelative
{
    ATTACH_RELATIVE_NONE,
    ATTACH_NORTH_OF,
    ATTACH_WEST_OF,
    ATTACH_SOUTH_OF,
    ATTACH_EAST_OF,
    ATTACH_TAB_WITH,
    ATTACH_TO_PARENT,
    ATTACH_REPLACE
};

enum EAttachFlags
{
    ATTACH_NONE=0,
    ATTACH_VERTICAL=(1<<0),
    ATTACH_CLOSE=(1<<1),
    ATTACH_BAR=(1<<4),
    ATTACH_SHOW=(1<<5),
    ATTACH_TOOLBAR=(1<<6),
    ATTACH_MENUBAR=(1<<7),
    ATTACH_STATUSBAR=(1<<8),
    ATTACH_TAB=(1<<9),
    ATTACH_RULERBOX=(1<<10)
};

DECLARE_ENUM_BITOPS(EAttachFlags);

//! event types (for event selection)
enum EEvents
{
    EVENT_NONE=0,
    EVENT_KEYDOWN=      (1<<0), //!< key pressed
    EVENT_KEYUP=        (1<<1), //!< key released
    EVENT_KEY=          (EVENT_KEYDOWN|EVENT_KEYUP),//!< any key event
    EVENT_CHAR=         (1<<2), //!< key event resulting in a character
    EVENT_KEYBOARD=     (EVENT_KEY|EVENT_CHAR), //!< any keyboard event
    EVENT_BUTTONDOWN=   (1<<3), //!< button pressed
    EVENT_BUTTONUP=     (1<<4), //!< button released
    EVENT_BUTTON=       (EVENT_BUTTONDOWN|EVENT_BUTTONUP), //!< any button event
    EVENT_DBLCLICK=     (1<<5), //!< double click
    EVENT_BUTTONMOVE=   (1<<6), //!< move mouse while button is pressed
    EVENT_MOUSEMOVE=    (1<<7), //!< move mouse
    EVENT_MOUSEENTER=   (1<<8), //!< mouse entering or leaving the window
    EVENT_MOVE=         (1<<9), //!< window moved
    EVENT_SIZE=         (1<<10),//!< window resized
    EVENT_GEOMETRY=     (EVENT_MOVE|EVENT_SIZE),    //!< window geometry changed
    EVENT_FOCUS=        (1<<11),//!< focus acquired or lost
    EVENT_EXPOSE=       (1<<12),//!< sent when the window must be redrawn
    EVENT_CHILDREQUESTS=(1<<14),//!< receive mapping or geometry requests from children
    EVENT_COLORMAP=     (1<<15),//!< a colormap has been installed
    EVENT_PROPERTY=     (1<<16),//!< property changed in the window
    EVENT_CHILDGEOMETRY=(1<<17),//!< geometry of a child changed
    EVENT_SHAPE=        (1<<18),//!< shape events
    EVENT_DEFAULT=(EVENT_BUTTON|EVENT_EXPOSE|EVENT_MOUSEMOVE|
    EVENT_MOUSEENTER|EVENT_FOCUS|EVENT_KEYBOARD|EVENT_GEOMETRY)
};

DECLARE_ENUM_BITOPS(EEvents);

enum EDialogResult
{
    DIALOG_CANCEL,
    DIALOG_OK
};

///window types
enum class EWindowType
{
    DESKTOP,        ///< is the desktop
    DOCK,           ///< is a panel (or dock)
    TOOLBAR,        ///< is a toolbar-like window
    MENU,           ///< is a menu
    UTILITY,        ///< is a utility window
    SPLASH,         ///< is a splash window
    DIALOG,         ///< is a dialog box
    DROPDOWNMENU,   ///< is a dropdown menu
    POPUPMENU,      ///< is a popup menu
    TOOLTIP,        ///< is a tooltip
    NOTIFICATION,   ///< is a notification
    COMBO,          ///< is a combo dropdown list
    DND,            ///< is a drag icon
    MESSAGEBOX,     ///< is a message box
    NORMAL          ///< normal window
};

///window state
enum class EWindowState
{
    NONE=0,
    ICONIC=(1<<1),    //!< is minimized
    SHADED=(1<<2),    //!< is shaded
    MAXHORZ=(1<<4),   //!< is horizontally maximized
    MAXVERT=(1<<5),   //!< is vertically maximized
    MAX=MAXHORZ|MAXVERT,
    FULLSCREEN=(1<<6),//!< full-screen mode
    STICKY=(1<<7),    ///< appear in all desktops
    ONTOP=(1<<8)
};

DECLARE_ENUM_CLASS_BITOPS(EWindowState);

///possible actions
enum class EWindowActions
{
    NONE=0,
    DOCK=(1<<9),
    MINIMIZE=(1<<10),
    CLOSE=(1<<11),
    HIDE=(1<<12),

    ALL=DOCK|MINIMIZE|CLOSE|HIDE
};

DECLARE_ENUM_CLASS_BITOPS(EWindowActions)

typedef int64_t TID;

///@}

/*namespace gui*/ } /*namespace buola*/ }

#endif
